#include <iostream>

using std::cout;
using std::endl;
#include <exception>
using std::exception;

void throwException()
{

	try
	{
		cout<<"Function throwException throws an exception\n";
		throw exception();
	}
	catch(exception &)
	{
		cout<<"Exception handled in function throw exception\n";
		cout<<"Function throwException rethrow exception";
		throw;
	}
	cout<<"Nu ar trebii sa apara\n";
}

int main()
{
	try
	{
		cout<<"\nmain invokes function throw exception\n";
		throwException();
		cout<<"nu ar trebuii sa apara\n";
	}
	catch(exception &)
	{
		cout<<"\n\nException Handled in main\n";
	}
	cout<<"Program control cotinues after catch in main\n";
return 0;
}
